function SeniorSettingsCtrl($rootScope,$scope,$http,$timeout){
	
	$scope.fontSize = globalAppParams.fontSize;
	$scope.keyboardEnabled = globalAppParams.keyboard;
	
	$scope.actionUrl = "/saftalk/family/settings";
	$scope.submitButton = new Object();
	
	initSubmitButton=function () {

		$scope.submitButton.label="שמור";
		$scope.submitButton.disabled="";
	}
	disableSubmitButton=function () {
		$scope.submitButton.label="המתן...";
		$scope.submitButton.disabled="disabled";
	}
	initSubmitButton();
	
		
	$scope.saveSettings = function() {
		disableSubmitButton();
		var myParams = {keyboardEnabled: $scope.keyboardEnabled, fontSize: $scope.fontSize};
		
		$http({
			method: 'POST',
			url: $scope.actionUrl, 
			data: $.param(myParams),
			headers: {'Content-Type': 'application/x-www-form-urlencoded'}
			}).success(function(data) {
            if (!data.success) {            	
            	console.log("Failed to edit settings");
				initSubmitButton();
                return; 
            } else {
            	$('#seniorSettingsPopUp').bPopup().close();
            }
		});
		
	}
	
	$scope.cancelSettings = function() {
		$('#seniorSettingsPopUp').bPopup().close();
	}
	
}